﻿Imports TBCC.Utility
Public Class RoleClass

    ''' <summary>
    ''' 通过角色类型获取角色对应的字符串
    ''' </summary>
    ''' <param name="re"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function GetRolename(ByVal re As RoleType) As String
        Dim strRole As String = ""
        Select Case re
            Case RoleType.Admin
                strRole = "Admin"

            Case RoleType.HighLevel
                strRole = "HighLevel"

            Case RoleType.MiddleLevel
                strRole = "MiddleLevel"

            Case RoleType.NormalLevel
                strRole = "NormalLevel"

            Case Else
                strRole = ""
        End Select

        Return strRole
    End Function

    Public Shared Function GetRoles() As DataTable
        Dim strSql As String
        strSql = "Select * From tbccRoles"

        Dim ds As DataSet
        ds = SqlHelper.ExecuteDataset(strSql, Nothing)

        Return ds.Tables(0)
    End Function

End Class
